<?php 

$dados = $view->result; 

$tipoComunicacao = $dados[0]->field_field_tipo_da_comunica_o[0]['rendered']["#markup"];

$strUrl = ($tipoComunicacao == "Clipping") ? "/comunicacao/clipping" : "/comunicacao/releases";
    

?>

<div class="comunication lbottom">
    <div class="container">
        <div class="row">
        <div class="col-md-12">
            <div style="text-align: center">
            <h1> <?php print $tipoComunicacao;?> </h1>
            </div>
        </div>
            
        <?php foreach ($dados as $value):
            
            $titulo = $value->node_title;
            $data_criacao = format_date($value->node_created, 'chamadas_blogs');
            $nid = $value->nid;
            $url_link = drupal_get_path_alias('node/'.$nid);
            
            $texto = trim($value->field_body[0]['rendered']['#markup']);
            
            ?>
        <div class="col-md-4">
                <div class="post">
                        <span class="post-date"> <?php print $data_criacao;?> </span>
                        <div class="post-title"> <?php print $titulo?> </div>
                        <div class="post-description"> 
                            <?php print $texto?>
                            <div class="btn-more"><a href="/<?php print $url_link?>">Ler mais <em>+</em></a></div>
                        </div>
                </div>
        </div>

        <?php endforeach;?>
            <div class="col-md-12">
                <div style="text-align: center;margin-top:15px;">
                <span class="btn-view-all"><a href="<?= $strUrl ?>">ver todas</a></span>
                </div>
            </div>
        </div>
    </div>
</div>